home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
User's Choice Windows CD
/
User's Choice Windows CD (CMS Software)(1993).iso
/
win_q_t
/
trem.zip
/
HANDLER.C
< prev
next >
Wrap
Text File
|
1991-05-11
|
2KB
|
65 lines
/************************************************************************
*
* Copyright (c) 1991 Microsoft Corporation. All Rights Reserved.
*
*-----------------------------------------------------------------------
*
* Project: Windows Terminal Example
*
* Module: handler.c
*
* Author: Bryan A. Woodruff (baw)
*
*
* Remarks: Timer Handler
*
* Revisions:
* 01.00.000 5/ 9/91 baw Wrote it.
*
***********************************************************************/
#include "terminal.h"
/************************************************************************
* WORD FAR PASCAL TimerHandler( HWND hWnd, WORD wMsg, int nIdEvent,
* DWORD dwTime )
*
* Description:
* This is a timer handler. It checks the COM event flags
* and posts a message to the associated window.
*
* Comments:
* 5/ 8/91 baw Wrote it
* 5/11/91 baw Modifications to make it "nice".
*
************************************************************************/
WORD FAR PASCAL TimerHandler( HWND hWnd, WORD wMsg, int nIdEvent,
DWORD dwTime )
{
int i ;
WORD wEvent ;
EVENT FAR *lpEvent ;
for (i = 0; i < MAXEVENTS; i++)
{
lpEvent = &aEvents[i] ;
if ((!lpEvent -> fPostFlag) && (NULL != lpEvent -> hWnd))
{
wEvent = *(lpEvent -> lpEventPtr) ;
if (wEvent & lpEvent -> wEventMask)
{
PostMessage( lpEvent -> hWnd, lpEvent -> wMsg, wEvent, 0L ) ;
lpEvent -> fPostFlag = TRUE ;
}
}
}
return ( 1 ) ;
} /* end of TimerHandler() */
/************************************************************************
* End of File: handler.c
************************************************************************/